#include <iostream>
#include <string>
#include <cctype>
#include <iterator>
using namespace std;

int getPositiveNumber() {
    string input;
    int number;

    while (true) {
        cout << "Enter height: ";
        getline(cin, input);

        bool valid = true;
        for (char c : input) {
            if (!isdigit(c)) {
                valid = false;
                break;
            }
        }

        if (!valid || input.empty()) {
            cout << "Invalid input, please enter a positive number" << endl;
            continue;
        }

        number = stoi(input);

        if (number <= 0) {
            cout << "Invalid input, please enter a positive number" << endl;
            continue;
        }

        break;
    }
    return number;
}
void number_print(int number) {
    int max_digits = to_string(number).length();
    for (int i =1; i <= number; ++i){
            char ch = '0' + i;  //>*<' 正确'转换数字到字符
            fill_n(ostream_iterator<char>(cout), i, ch);
            cout << endl;
        }
    }
int main(){
    int number=getPositiveNumber();
    number_print(number);
    return 0;

}